﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace BT_web__nhom06.BiThuChiDoan
{
    public partial class vidulocdvtheochidoan : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //string a = "select * from chidoan";
            DataTable tbl2 = Tienichsql.ketnoicsdl.ChayLenhSelectDuLieu("SELECT * FROM ChiDoan");

            ListChiDoan.DataSource = tbl2;
            ListChiDoan.DataTextField = "tenchidoan";
            ListChiDoan.DataValueField = "machidoan";
                      
            ListChiDoan.DataBind();
            
            
        }

        protected void ListChiDoan_SelectedIndexChanged(object sender, EventArgs e)
        {
            //lblChiDoan.Text = (string)ListChiDoan.SelectedValue;
            //string a = "SELECT * FROM DoanVien where madoanvien='"+ ListChiDoan.SelectedValue+"'";
            string machidoan=ListChiDoan.SelectedValue;
            DataTable tbl3 = Tienichsql.ketnoicsdl.ChayLenhSelectDuLieu("SELECT * FROM DoanVien where machidoan=@machidoan",machidoan);

            GridView1.DataSource = tbl3;
            GridView1.DataBind();
        }
    }
}